package com.example.canhui01li.myapprxretrofitdagger;

import android.os.Environment;

import com.lch.base.http.annotation.APIHeader;
import com.lch.base.http.annotation.APIIgnore;
import com.lch.base.http.annotation.APIMulti;
import com.lch.base.http.annotation.APIPath;
import com.lch.base.http.annotation.APIReq;
import com.lch.base.http.model.params.BaseParam;

import java.io.File;

/**
 * @author lee
 * @version 1.0 on 17/12/9.
 */

public class TestParams extends BaseParam{
    //---url替换参数
    @APIPath(name = "bac")
    public String urlPath = "urlPathRepelce1";


    //-------头部请求参数
    @APIHeader(name = "APIHeaderCustomName")
    public String userAgent = "123321";

    @APIHeader
    public String headerString = "我是中文头部";

    //-------req请求参数

    @APIReq(name = "APIReqCustomName")
    public String urlReqString = "我是中文req";

    public String account = "123@qq.com";
    public String password = "123456";


    //------APIMulti请求参数
    @APIMulti(name = "APIMultiCustomName")
    public String bodyParmas = "我是APIMulti";

    @APIMulti
    public File bodyFile = new File(getSDPath() + "/hs_user.txt");

    @APIMulti
    byte[]  mBytes = new String("我是bute").getBytes();

    //---APIIgnore不显示参数
    @APIIgnore
    public String goneParmas = "我是不显示的参数";



    public String getSDPath(){
        File sdDir = null;
        boolean sdCardExist = Environment.getExternalStorageState()
                .equals(Environment.MEDIA_MOUNTED);//判断sd卡是否存在
        if(sdCardExist)
        {
            sdDir = Environment.getExternalStorageDirectory();//获取跟目录
        }
        return sdDir.toString();
    }
}
